//
//  LMUtilsDefine.h
//  Conva
//
//  Created by cruise on 2017/12/25.
//  Copyright © 2017年 com.conva. All rights reserved.
//

#ifndef LMUtilsDefine_h
#define LMUtilsDefine_h

#define GVUD [GVUserDefaults standardUserDefaults]

#import "GVUserDefaults+User.h"
#import "Masonry.h"
#import "UIImageView+WebCache.h"
#import "MBProgressHUD+LM.h"

//请求域名
#define BASE_SERVICE_DOMAIN @"https://lnh.hyugui.com/api/"
#define BASE_IMAGE_DOMAIN @"https://lnh.hyugui.com"

//获取Class Name
#define GCN(className) [NSString stringWithUTF8String:object_getClassName([className class])]

#pragma mark - 基础颜色

#define LMTHEMECOLOR  HEX_RGB(0x0177D7)

#pragma mark - 设备信息

#define isIPhoneX ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? [[UIScreen mainScreen] currentMode].size.height==2436 : NO)
#define isIPhone5 (([[UIScreen mainScreen] bounds].size.height == 568) ? YES : NO)
#define isIPhone6 (667 == [[UIScreen mainScreen] bounds].size.height ? YES : NO)
#define isIPhonePlus (736 == [[UIScreen mainScreen] bounds].size.height ? YES : NO)

#define SCREEN_WIDTH                ([UIScreen mainScreen].bounds.size.width)
#define SCREEN_HEIGHT               ([UIScreen mainScreen].bounds.size.height)

//导航栏高度、宽度
#define NAV_WIDTH                   SCREEN_WIDTH
#define NAV_HEIGHT  isIPhoneX ? 88 : 64

//底部Tabbar 高度、宽度
#define TAB_BAR_WIDTH               SCREEN_WIDTH
#define TAB_BAR_HEIGHT  isIPhoneX ? 83 : 49

#define BOTTOM_SAFE_AREA_HEIGHT isIPhoneX ? 34 : 0

//状态栏高度
#define  STATUS_BAR_HEIGHT  isIPhoneX ? 44 : 20

#define SCALE (SCREEN_WIDTH/414.0)
#define VS(size) SCALE*size
#define FS(size) [UIFont systemFontOfSize:SCALE*size]
#define BFS(size) [UIFont boldSystemFontOfSize:SCALE*size]

//1像素
#define ONE_PIXEL (1 / [UIScreen mainScreen].scale)


#pragma mark - 版本检查

// 版本检查
#define IOS11_OR_LATER    ( [[[UIDevice currentDevice] systemVersion] compare:@"11.0" options:NSNumericSearch] != NSOrderedAscending )
#define IOS10_OR_LATER    ( [[[UIDevice currentDevice] systemVersion] compare:@"10.0" options:NSNumericSearch] != NSOrderedAscending )
#define IOS9_OR_LATER    ( [[[UIDevice currentDevice] systemVersion] compare:@"9.0" options:NSNumericSearch] != NSOrderedAscending )
#define IOS8_OR_LATER    ( [[[UIDevice currentDevice] systemVersion] compare:@"8.0" options:NSNumericSearch] != NSOrderedAscending )
#define IOS7_OR_LATER    ( [[[UIDevice currentDevice] systemVersion] compare:@"7.0" options:NSNumericSearch] != NSOrderedAscending )
#define IOS6_OR_LATER    ( [[[UIDevice currentDevice] systemVersion] compare:@"6.0" options:NSNumericSearch] != NSOrderedAscending )
#define IOS5_OR_LATER    ( [[[UIDevice currentDevice] systemVersion] compare:@"5.0" options:NSNumericSearch] != NSOrderedAscending )
#define IOS4_OR_LATER    ( [[[UIDevice currentDevice] systemVersion] compare:@"4.0" options:NSNumericSearch] != NSOrderedAscending )
#define IOS3_OR_LATER    ( [[[UIDevice currentDevice] systemVersion] compare:@"3.0" options:NSNumericSearch] != NSOrderedAscending )

#endif /* LMUtilsDefine_h */
